package com.dong.bean;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

public class Cat  implements InitializingBean, DisposableBean {
    public Cat() {
        System.out.println("cat construct ...");
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("cat destory()....  接口的销毁方法");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("cat init() ...    接口的初始化方法");
    }


    public void afterPropertiesSet1() throws Exception {
        System.out.println("cat init() ...    标记的初始化方法");
    }

    public void destroy1() throws Exception {
        System.out.println("cat destory()....  标记的销毁方法");
    }
  //  @PostConstruct
    public void afterPropertiesSet2() throws Exception {
        System.out.println("cat init() ...    注解的初始化方法");
    }
//@PreDestroy
    public void destroy2() throws Exception {
        System.out.println("cat destory()....  注解的销毁方法");
    }


}
